<template>
    <div>
        <h1>开始一个请假流程</h1>
        <table>
            <tr>
                <td>请输入姓名：</td>
                <td>
                    <el-input type="text" v-model="afl.name" />
                </td>
            </tr>
            <tr>
                <td>请输入请假天数：</td>
                <td>
                    <el-input type="text" v-model="afl.days" />
                </td>
            </tr>
            <tr>
                <td>请输入请假理由：</td>
                <td>
                    <el-input type="text" v-model="afl.reason" />
                </td>
            </tr>
        </table>
        <el-button type="primary" @click="submit">提交请假申请</el-button>
    </div>
</template>
<script>
import api from "@/api/flowable/test";
export default {
    data() {
        return {
            afl: {
                name: 'javaboy',
                days: 3,
                reason: '休息一下'
            }
        }
    },
    methods: {
        async submit() {
            let _this = this;
            let res = await api.test1(this.afl);
            console.log(res);

            // axios.post('127.0.0.1:8085//flowable/flowtest/askForLeave', this.afl)
            //     .then(function (response) {
            //         if (response.data.status == 200) {
            //             //提交成功
            //             _this.$message.success(response.data.msg);
            //         } else {
            //             //提交失败
            //             _this.$message.error(response.data.msg);
            //         }
            //     })
            //     .catch(function (error) {
            //         console.log(error);
            //     });
        }
    }
}
</script>